from config import HOST


class ApiApproveTrust:
    def __init__(self, session):
        self.session = session
        self.__url_approve = HOST + "/member/realname/approverealname"
        self.__url_approve_status = HOST + "/member/member/getapprove"
        self.__url_trust = HOST + "/trust/trust/register"

    def api_approve(self):
        data = {
            "realname": "张三",
            "card_id": "110101201703072050"
        }
        # 2、调用方法 难点：请求要 multipart-form/data -> data + files
        return self.session.post(url=self.__url_approve, data=data, files={"": ""})

    def api_approve_status(self):
        return self.session.post(url=self.__url_approve_status)

    def api_trust(self):
        return self.session.post(url=self.__url_trust)
